package Game;


import java.util.Random;
import java.util.Scanner;

public class gameStart {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        GameInit gi = new GameInit();
        gi.gameProcessStart();
        int money;
        System.out.println(gi.player.getMoney());
        while (gi.player.getMoney() > 0 && gi.cPlayer1.getMoney() > 0 && gi.cPlayer2.getMoney() > 0 && gi.cPlayer3.getMoney() > 0){
            if (gi.g.allIn(gi.player, 0) == 1) {
                System.out.println("由于你allIn，其他玩家只能选择allIn或者弃牌");
                gi.cg.allIn(gi.cPlayer1, r.nextInt(2));
                gi.cg.allIn(gi.cPlayer2, r.nextInt(2));
                gi.cg.allIn(gi.cPlayer3, r.nextInt(2));
            }else {
                money = gi.g.bet(gi.player);
                money = gi.cg.withBet(gi.cPlayer1, money);
                money = gi.cg.withBet(gi.cPlayer2, money);
                money = gi.cg.withBet(gi.cPlayer3, money);
            }
        }
        System.out.println("开始比大小了");
        System.out.println("----------------");
        if (gi.gameResult()) System.out.println("恭喜您获胜了！");
        else System.out.println("很遗憾，您输了...");

    }
}
//        int money = g.bet(player);
//        System.out.println("轮到电脑下注");
//        cg.bet(cPlayer1);
//        cg.bet(cPlayer2);
//        cg.bet(cPlayer3);
//        int totalMoneyPool0 = g.withBet(player, money);
//        int totalMoneyPool1 = cg.withBet(cPlayer1, money);
//        int totalMoneyPool2 = cg.withBet(cPlayer2, money);
//        int totalMoneyPool3 = cg.withBet(cPlayer3, money);
//        System.out.println("当前奖池金额为：" + (totalMoneyPool1 + totalMoneyPool0 + totalMoneyPool2 + totalMoneyPool3));
//        g.allIn(player);
//        cg.allIn(cPlayer1);
//        cg.allIn(cPlayer2);
//        cg.allIn(cPlayer3);


